<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<!DOCTYPE html>
<html>
<head>
<jsp:include page="../header.jsp">
<jsp:param value="员工管理 - 教员界面" name="title"/>
</jsp:include>
<link href="static/css/base-css.css" rel="stylesheet" type="text/css">
<link href="static/css/teacher.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="static/js/employ.js"></script>
</head>
<body>
	<jsp:include page="../menu/manage_menu.jsp"></jsp:include>
	<div class="teacher-content" style="margin-right: 100px; margin-left: 150px; margin-top: 50px;" >
		<table class="ui celled striped table">
			<thead>
				<tr>
					<th colspan="9">员工列表</th>
				</tr>
				<tr>
					<th colspan="9">
						<div style="float:left;">
							<div class="ui buttons">
								<a href="employee/add" class="ui button" style="background: #666;color:#fff;"> 
								<i class="icon user"></i>
									创建员工
								</a>
								<button class="ui button" id="delete">
									<i class="icon trash"></i> 删除员工
								</button>
							</div>
						</div>
						<div class="searcher" style="float:right;">
							<form>
								<div class="ui form">
									<div class="fields">
										<div class="field">
											<input type="text" name="userName" value="${param.userName }" placeholder="输入姓名搜索">
										</div>
										<div class="field">
											<input type="text" name="dept" value="${param.dept }" placeholder="输入部门搜索">
										</div>
										<div class="field">
											<button class="ui submit button">检索</button>
										</div>
									</div>
								</div>
							</form>
						</div>
					</th>
				</tr>
			</thead>
			<tbody>
				<tr id="tr2">
					<td class="collapsing">
						<div class="ui checkbox">
							<input type="checkbox" id="checkAll">
						</div>
					</td>
					<td class="collapsing">姓名</td>
					<td class="collapsing">性别</td>
					<td class="collapsing">电话</td>
					<td class="collapsing">部门</td>
					<td class="collapsing">邮箱</td>
					<td class="collapsing">状态</td>
					<td class="collapsing">创建时间</td>
					<td class="collapsing" colspan="2">&nbsp</td>
				</tr>
				<c:forEach items="${emploList }" var="emplo">
				
					<tr id="tr2">
						<td class="collapsing">
							<div class="ui checkbox">
								<input class="item-check" type="checkbox" value="${emplo.id }">
							</div>
						</td>
						
						<td class="collapsing">${emplo.userName}</td>
						<td class="collapsing">${emplo.gender }</td>
						<td class="collapsing">${emplo.telphone}</td>
						<td>${emplo.deptId}</td> 
						<td>${emplo.email}</td>
						<td>${emplo.status}</td>
						<td><fmt:formatDate value="${emplo.regTime}" type="both"></fmt:formatDate></td>
						<td class="collapsing">
						<a onclick="return confirm('确认删除？')"
							class="ui label" style="color:#fff; background: #666;"
							href="employee/delete?eid=${emplo.id}"> 删除
						</a>
						<a class="ui label"
							href="employee/add?eid=${emplo.id}">编辑</a>
						</td>
						
					</tr>
				</c:forEach>
				<c:if test="${empty emploList}">
					<tr>
						<td style="text-align: center;" colspan="9">暂无记录</td>
					</tr>
				</c:if>
			</tbody>
		</table>
		<c:if test="${totalPage > 1 }">
			<div class="page">
				<a <c:if test="${page!=1}">href="employee?page=1${queryString}"</c:if>
					class="${page == 1?'disable':''}" style="color:#666"><i class="fast backward icon"></i>首页
				</a>
				<a <c:if test="${page!=1}">href="employee?page=${page-1}${queryString}"</c:if>
					class="${page == 1?'disable':''}" style="color:#666"><i class="backward icon"></i>上一页
				</a>
				<a <c:if test="${page!=totalPage}">href="employee?page=${page+1 }${queryString}"</c:if>
					class="${page == totalPage?'disable':''}" style="color:#666">下一页<i class="forward icon"></i>
				</a>
				<a <c:if test="${page!=totalPage}">href="employee?page=${totalPage }${queryString}"</c:if>
					class="${page == totalPage?'disable':''}" style="color:#666">尾页<i class="fast forward icon"></i>
				</a>
				<span style="float:right">${page}/${totalPage }</span>
					
			</div>
		</c:if>
	</div>
</body>
</html>